package com.jch.helloworld.configBeans.factoryBean;

import org.springframework.beans.factory.FactoryBean;

// FactoryBean 示例
public class DemoFactoryBean implements FactoryBean<BeanDemo> {

    // 获取bean
    @Override
    public BeanDemo getObject() throws Exception {
        return new BeanDemo("FactoryBean: BeanDome 实例","attr0 -> 1","1");
    }

    // 获取bean类型
    @Override
    public Class<?> getObjectType() {
        return BeanDemo.class;
    }

    // 是否为单例
    @Override
    public boolean isSingleton() {
        return true;
    }
}
